import socket_m from '../../util/connect'
import tempGroups_m from '../../util/groupData'
import store from '../../store/index'

async function getAllTempGroups_fn() {
  socket_m.sendMsg('getTempGroups', {}, o => {
    if (o.code === 0) {
      o.list.forEach(item => {
        item.messages.forEach(item1 => {
          item1.name = item.name
          item1.isConfirm = true
        })
        tempGroups_m.initItem(item)
      })
      console.log(tempGroups_m.groupList);
      store.commit('setIsLoadOk_fn')
    }
  })
}

export {
  getAllTempGroups_fn
}